// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   SongVerse.java

package presenter;

import java.util.Scanner;

public class SongVerse
{

    public SongVerse()
    {
        type = "";
    }

    public SongVerse(String input[])
    {
        if(input[0].length() > 3 && input[0].substring(0, 4).toUpperCase().equals("MISC"))
        {
            String input2[] = new String[input.length - 1];
            for(int i = 1; i < input.length; i++)
                input2[i - 1] = input[i];

            input = input2;
        }
        type = findType(input[0]);
        if(type.equals(""))
        {
            lyrics = input;
        } else
        {
            lyrics = new String[input.length - 1];
            for(int i = 1; i < input.length; i++)
                lyrics[i - 1] = input[i];

        }
    }

    private String findType(String s)
    {
        String temp = s.toUpperCase();
        if(temp.contains("CHORUS"))
        {
            Scanner sc = new Scanner(temp);
            sc.next();
            if(sc.hasNextInt())
                return (new StringBuilder()).append("Chorus ").append(sc.nextInt()).toString();
            else
                return "Chorus";
        }
        if(temp.contains("VERSE"))
        {
            Scanner sc = new Scanner(temp);
            sc.next();
            if(sc.hasNextInt())
                return (new StringBuilder()).append("Verse ").append(temp.substring(6, 7)).toString();
            else
                return "Verse";
        }
        if(temp.contains("BRIDGE"))
            return "Bridge";
        if(temp.contains("ENDING"))
            return "Ending";
        if(temp.contains("PRE-CHORUS"))
            return "Pre-Chorus";
        if(temp.contains("TAG"))
            return "Tag";
        else
            return "";
    }

    public String[] getLyrics()
    {
        return lyrics;
    }

    public String getType()
    {
        return type;
    }

    public String toString()
    {
        String result = "<html> <p style=\"text-align: center;\"> ";
        if(!type.equals(""))
            result = (new StringBuilder()).append(result).append("<b>").append(type).append("</b><br>").toString();
        for(int i = 0; i < lyrics.length; i++)
        {
            result = (new StringBuilder()).append(result).append(lyrics[i]).toString();
            result = (new StringBuilder()).append(result).append(" <br> ").toString();
        }

        result = (new StringBuilder()).append(result).append(" </html>").toString();
        return result;
    }

    public void setType(String type)
    {
        this.type = type;
    }

    public void setText(String input[])
    {
        lyrics = input;
    }

    String lyrics[];
    String type;
}
